import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
// 在工程化环境下 Vue插件必须 Vue.use(插件)
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    component: Home
  },
  {
    path: '/about',
    // 路由懒加载
    component: () => import('../views/About')
  }
]

const router = new VueRouter({
  routes
})

export default router
